﻿
$.MGJ.PrivilegeManage = [];


(function () {
    var _this = $.MGJ.PrivilegeManage;
    $.extend($.MGJ.PrivilegeManage, {
        // 新增用户
        Dialog_AddPrivilegeObj: null,
        Dialog_AddPrivilege: function () {

            //$my.GetPCR(0, 0);
            this.Dialog_AddPrivilegeObj = $.L.dialog({
                url: ACTION_URL("AddPrivilege", "Manager"),
                title: "添加菜单",
                width: 700,
                height: "auto",
                buttons: {
                    "button_save": {
                        type: 'primary',
                        text: '保存',
                        click: function () {
                            $.MGJ.PrivilegeManage.Ajax_AddEnterprise();
                        }
                    },
                    "button_cancel": {
                        type: 'default',
                        text: '取消',
                        click: 'MODALMISS'
                    }
                }
            });
        },

        Dialog_EditPrivilegeObj: null,
        Dialog_EditPrivilege: function () {
            this.Dialog_EditPrivilegeObj = $.L.dialog({
                url: ACTION_URL("EditPrivilege", "Manager"),
                title: "编辑权限",
                width: 700,
                height: "auto",
                buttons: {
                    "button_save": {
                        type: 'primary',
                        text: '保存',
                        click: function () {
                            $.L.msgError(1);
                        }
                    },
                    "button_cancel": {
                        type: 'default',
                        text: '取消',
                        click: 'MODALMISS'
                    }
                }
            });

        }
    });
})(jQuery);





(function () {
    var _this = $.MGJ.PrivilegeManage;
    $.extend($.MGJ.PrivilegeManage, {
        //查询菜单
        Ajax_GetMenuInfo: function (ThisDom) {
            $.L.ajaxHandle({
                url: ACTION_URL("GetMenuInfo", "Manager"),
                data: {
                    ParentId: ParentId
                },
                success: function (response) {
                    $("#menuinfoid").L_bindingDataList(response);
                }
            })
        }

    });
})(jQuery);
(function () {
    var _this = $.MGJ.PrivilegeManage;
    $.extend($.MGJ.PrivilegeManage, {


    });
})(jQuery);

//编辑权限 添加菜单 全选
function PrivilegeAllCheckbox(){

}
$(document).on("change", ".OneLevelMenu,.TwoLevelMenu", function () {
    var ThisDomClass = $(this).attr("class");
    var ThisDomName = $(this).attr("name");
    var ThisDomtlname = $(this).attr("tlname");
    if (ThisDomClass == "OneLevelMenu") {
        if ($(this).is(':checked')) {

            $("input[name='" + ThisDomName + "']").each(function () {
                this.checked = true;
            });
        } else {
            $("input[name='" + ThisDomName + "']").each(function () {
                this.checked = false;
            });
        }
    } else {
        if ($(this).is(':checked')) {
            $("input[tlname='" + ThisDomtlname + "']").each(function () {
                this.checked = true;
            });
        } else {
            $("input[tlname='" + ThisDomtlname + "']").each(function () {
                this.checked = false;
            });
        }
    }
})

